package com.gitee.wsl.struct.router

import com.gitee.wsl.test.forAll
import com.gitee.wsl.test.row
import kotlin.test.Test

class UriResourceResultTest {

    @Test
    fun createUriPatternTest(){
        val scrou = UriResource<Any>("https://tools.ietf.org/html/:test/:last")
        forAll(
            row("https://foo@google.com/?q=bar baz#"),
            row("https://tools.ietf.org/html/rfc5849#section-3.6"),
            row("https://tools.ietf.org/html/1220"),
            row("https://tools.ietf.org/html/:test"),
            row("https://tools.ietf.org/html/:test/:last"),
            row("http://www{.domain}{/path}{?var:5,col,map}{&var*:2,col:1*,map*")
        ){
            println(createUriPattern(it))
            println(scrou.match(it))
        }
    }
}